xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Fri, 15 Mar 2013 16:33:30 +0000 (12:33 -0400)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 16 Apr 2013 15:21:50 +0000 (16:21 +0100)
commit8f28de1ec060318d74fa6ad853e814d6a1bf0ba2
tree968dfd2a674332ffa1f2a10b53f4725bc9ed8bab
parentad0fcc9fe5cac8cc79b3ec9508aa655220f1a314
xl: 'xl info' print outstanding claims if enabled (claim_mode=1 in xl.conf)

This patch provides the value of the currently outstanding pages
claimed for all domains. This is a total global value that influences
the hypervisors' MM system.

When a claim call is done, a reservation for a specific amount of pages
is set and also a global value is incremented. This global value is then
reduced as the domain's memory is populated and eventually reaches zero.
The toolstack (libxc) also sets the domain's claim to zero when the population
of memory has completed as an extra step. Any call to destroy the domain
will also set the domain's claim to zero.

If the reservation cannot be meet the guest creation fails immediately
instead of taking seconds or minutes (depending on the size of the guest)
while the toolstack populates memory.

See patch: "xl: Implement XENMEM_claim_pages support via 'claim_mode'
global config" for details on how it is implemented.

The value fluctuates quite often so the value is stale once it is provided
to the user-space.  However it is useful for diagnostic purposes.

It is only printed when the global "claim_mode" option in xl.conf(5)
is set to enabled (1). The 'man xl' shows the details of this item.

[v1: s/unclaimed/outstanding/]
[v2: Made libxl_get_claiminfo return just MemKB suggested by Ian Campbell]
[v3: Made libxl_get_claininfo return MemMB to conform to the other values printed]
[v4: Improvements suggested by Ian Jackson, also added docs to xl.pod.1]
[v5: Clarify how claims are cancelled, split >72 characters - Ian Jackson]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
docs/man/xl.pod.1
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/xl_cmdimpl.c